/* 
 * Author: Alexander Rauser, arauser.org
 * Date: August 2008
 * Copyright: 2008
 * Licensed under Creative Commons Attribution 3.0 Unported
 */
 
package org.arauser.uploader.controller
{

	
	import org.puremvc.as3.interfaces.*;
	import org.puremvc.as3.patterns.command.*;
	import org.puremvc.as3.patterns.observer.*;
	
	import org.arauser.uploader.model.SettingsProxy;
	import org.arauser.uploader.ApplicationFacade;

	public class LoadSettingsCommand extends SimpleCommand
	{
		override public function execute( note : INotification ) : void {
			
			// We get the Proxy and load the settings, if none are defined we notify
			// the application to show the config page.
			var proxy:SettingsProxy = SettingsProxy(ApplicationFacade.getInstance().retrieveProxy(SettingsProxy.NAME));
            
            if(proxy.settings['uploadURL'] == null || proxy.settings['uploadURL'] == "")
            {
            	sendNotification(ApplicationFacade.SETCONFIG, null);
            }
		}

	}
}